home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr57 / nwnt.zip / NWNT.EXE / OEMNADNA.INF < prev    next >
INI File  |  1993-04-22  |  32KB  |  1,106 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADNA.INF
  4. ;
  5. ;       Novell ODI NE2 network card SETUP INF file.
  6. ;
  7. ;***********************************************************************
  8.  
  9. ;-----------------------------------------------------------------------
  10. ; OPTION TYPE
  11. ; -----------
  12. ; This identifies the Option type we are dealing with.  The different
  13. ; possible types are:
  14. ;
  15. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  16. ;
  17. ;  Types specific to networking:
  18. ;
  19. ; NetAdapter,        a netcard / adapter combination or just a netcard
  20. ; NetDriver,         just a netcard driver
  21. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  22. ; NetService,        an NT networking service
  23. ; NetWork,           a complete network ensemble.
  24. ; NetProvider        a complete network which supports NT MPR protocol
  25. ;-----------------------------------------------------------------------
  26.  
  27. [Identification]
  28.     OptionType = NetAdapter
  29.  
  30. ;-----------------------------------------------------------------------
  31. ; PlatformsSupported
  32. ; ------------------
  33. ; This identifies the platforms supported by the adapter card.
  34. ; Possible types are:
  35. ;
  36. ; ISA, EISA and MCA
  37. ;-----------------------------------------------------------------------
  38.  
  39. [PlatformsSupported]
  40.     MCA
  41.  
  42. ;-----------------------------------------------------------------------
  43. ; OPTION LIST
  44. ; -----------
  45. ; This section lists the OEM Option key names.  These keys are locale
  46. ; independent and used to represent the option in a locale independent
  47. ; manner.
  48. ;
  49. ;-----------------------------------------------------------------------
  50.  
  51. [Options]
  52.     ODI_NE2
  53.  
  54. [LanguagesSupported]
  55.     ENG
  56.  
  57. [OptionsTextENG]
  58.     ODI_NE2     = "ODI Novell NE2 Adapter"
  59.  
  60. ;***********************************************************************
  61. ; CONSTANTS FOR USING DIALOGS
  62. ;***********************************************************************
  63. [FileConstants]
  64. ;
  65. ;  File names, etc.
  66. ;
  67. UtilityInf      = "UTILITY.INF"
  68. ParamInf        = "NCPARAM.INF"
  69. subroutineinf   = "SUBROUTN.INF"
  70. Exit_Code       = 0
  71. ;ShellCode       = 0
  72.  
  73. ;
  74. ; EventLog Message File
  75. ;
  76. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  77. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  78.  
  79. ; Product Info
  80. ;
  81. Manufacturer    = "Novell"
  82. ProductMajorVersion     = "0"
  83. ProductMinorVersion     = "9"
  84. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  85. ;
  86. ; Hardware
  87. ;
  88. DriverName                   = "ODILOAD"
  89. OdiModules             = "ODI_Modules"
  90. ProductHardwareName          = "NE2"
  91. ProductHardwareODI_NE2Title   = "Novell NE2 ODI Adapter"
  92. NetRuleHardwareType          = "nwNE2 nwAdapter"
  93. NetRuleHardwareBindForm      = " yes yes container"
  94. ;
  95. ; Registry Key
  96. ;
  97. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(DriverName)"\CurrentVersion"
  98. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  99.  
  100. ;
  101. ;  Dialog Parameters
  102. ;
  103. ;IRQList   = ^(IRQChoices, 1)
  104. ;IRQValues = ^(IRQChoices, 2)
  105. ;IOBaseAddrHexList = ^(IOBaseAddrChoices, 1)
  106. ;IOBaseAddrDecList = ^(IOBaseAddrChoices, 2)
  107. ;IOBaseAddrNwList  = ^(IOBaseAddrChoices, 3)
  108.  
  109. ;[IRQChoices]
  110. ;IRQ_0 = "2",2
  111. ;IRQ_1 = "3",3
  112. ;IRQ_2 = "4",4
  113. ;IRQ_3 = "5",5
  114.  
  115. ;[IOBaseAddrChoices]
  116. ;IOBase_1  = "0x300",768,300
  117. ;IOBase_2  = "0x320",800,320
  118. ;IOBase_3  = "0x340",832,340
  119. ;IOBase_4  = "0x360",864,360
  120.  
  121. [DialogConstantsENG]
  122. Help        = "&Help"
  123. Exit        = "Cancel"
  124. OK          = "OK"
  125. HelpContext = ""
  126. Continue    = "Continue"
  127. Cancel      = "Cancel"
  128.  
  129. ;[FileDependentDlgENG]
  130. ;DlgType = "RadioCombination"
  131. ;DlgTemplate = "NE2000"
  132. ;Caption = $(FunctionTitle)
  133. ;Label1 = "&IRQ Level:"
  134. ;Label2 = "I/O &Port Address:"
  135. ;Combo1List = $(IRQList)
  136. ;Combo1Out  = $(IRQValue)
  137. ;Combo2List = $(IOBaseAddrHexList)
  138. ;Combo2Out  = $(IOBaseAddress)
  139. ;ComboListItemsIn  = {Combo1List, Combo2List}
  140. ;ComboListItemsOut = {Combo1Out, Combo2Out}
  141. ;EditTextIn = ""
  142. ;EditTextLim = ""
  143. ;CBOptionsGreyed = {}
  144. ;NotifyFields = {NO, NO}
  145. ;HelpContext = $(!IDH_DB_OEMNADN2_INS)
  146.  
  147. [FileConstantsENG]
  148. ProCaption   = "Netware for Windows NT Setup"
  149. ProCancel    = "Cancel"
  150. ProCancelMsg = "Netware for Windows NT is not correctly installed.  "+
  151.                "Are you sure you want to cancel copying files?"
  152. ProCancelCap = "Network Setup Message"
  153. ProText1     = "Copying:"
  154. ProText2     = "To:"
  155. FunctionTitle   = "Novell NE2 Network Card Setup"
  156. ProductSoftwareDescription      = "ODI Novell NE2 Adapter Driver"
  157. ProductHardwareODI_NE2Description        = "ODI Novell NE2 Adapter"
  158.  
  159. [GeneralConstants]
  160. ;
  161. ;  Program flow control variables.
  162. ;
  163. from      = ""
  164. to        = ""
  165. ;
  166. ;  Return codes; Exit_Code is set to one of these
  167. ;
  168. ExitCodeOk     = 0
  169. ExitCodeCancel = 1
  170. ExitCodeFatal  = 2
  171.  
  172. KeyNull         = ""
  173. MAXIMUM_ALLOWED   = 33554432
  174. RegistryErrorIndex = NO_ERROR
  175. KeyProduct      = ""
  176. KeyParameters   = ""
  177.  
  178. TRUE            = 1
  179. FALSE           = 0
  180. NoTitle            = 0
  181.  
  182. ExitState   = "Active"
  183. OldVersionExisted = $(FALSE)
  184.  
  185. DriverPath      = $(!STF_NTPATH)\drivers
  186.  
  187. [date]
  188.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  189.     ; Minute, Second }
  190.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  191.  
  192.  
  193. ;---------------------------------------------------------------------------
  194. ; 1. Identify
  195. ;
  196. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  197. ;                as we are choosing currently.
  198. ;
  199. ; INPUT:         None
  200. ;
  201. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  202. ;                $($R1): Option Type (COMPUTER ...)
  203. ;                $($R2): Diskette description
  204. ;---------------------------------------------------------------------------
  205.  
  206. [Identify]
  207.     ;
  208.     ;
  209.     read-syms Identification
  210.  
  211.     set Status     = STATUS_SUCCESSFUL
  212.     set Identifier = $(OptionType)
  213.     set Media      = #("Source Media Descriptions", 1, 1)
  214.  
  215.     Return $(Status) $(Identifier) $(Media)
  216.  
  217. ;------------------------------------------------------------------------
  218. ; 2. ReturnOptions:
  219. ;
  220. ; DESCRIPTION:   To return the option list supported by this INF and the
  221. ;                localised text list representing the options.
  222. ;
  223. ;
  224. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  225. ;
  226. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  227. ;                                STATUS_NOLANGUAGE
  228. ;                                STATUS_FAILED
  229. ;                                STATUS_NOTSUPPORTED
  230. ;
  231. ;                $($R1): Option List
  232. ;                $($R2): Option Text List
  233. ;------------------------------------------------------------------------
  234.  
  235. [ReturnOptions]
  236.     ;
  237.     ;
  238.     set Status        = STATUS_FAILED
  239.     set OptionList     = {}
  240.     set OptionTextList = {}
  241.  
  242.     ;
  243.     ; Check if the language requested is supported
  244.     ;
  245.     set LanguageList = ^(LanguagesSupported, 1)
  246.     Ifcontains(i) $($0) in $(LanguageList)
  247.         ;
  248.         ; Check if the platforms requested is supported
  249.         ;
  250.         ifstr(i) $($1) == ""
  251.            goto returnoptions
  252.         endif
  253.  
  254.         set PlatformList = ^(PlatformsSupported, 1)
  255.         Ifcontains(i) $($1) in $(PlatformList)
  256.            goto returnoptions
  257.         else
  258.            set Status = STATUS_NOTSUPPORTED
  259.            goto finish_ReturnOptions
  260.         endif
  261.     else
  262.         set Status = STATUS_NOLANGUAGE
  263.         goto finish_ReturnOptions
  264.     endif
  265.  
  266.     ;
  267.     ; form a list of all the options and another of the text representing
  268.     ;
  269.  
  270. returnoptions = +
  271.     set OptionList     = ^(Options, 1)
  272.     set OptionTextList = ^(OptionsText$($0), 1)
  273.     set Status         = STATUS_SUCCESSFUL
  274.  
  275. finish_ReturnOptions = +
  276.     Return $(Status) $(OptionList) $(OptionTextList)
  277.  
  278. ;----------InstallOption-------------------------------------------------
  279. ;
  280. ; InstallOption:
  281. ;
  282. ;      This section is shelled to by main installation processing
  283. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  284. ;
  285. ;
  286. ; FUNCTION:  To copy files representing Options
  287. ;            To configure the installed option
  288. ;            To update the registry for the installed option
  289. ;
  290. ; INPUT:     $($0):  Language to use
  291. ;            $($1):  OptionID to install
  292. ;            $($2):  SourceDirectory
  293. ;            $($3):  AddCopy  (YES | NO)
  294. ;            $($4):  DoCopy   (YES | NO)
  295. ;            $($5):  DoConfig (YES | NO)
  296. ;
  297. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  298. ;                            STATUS_NOLANGUAGE |
  299. ;                            STATUS_USERCANCEL |
  300. ;                            STATUS_FAILED
  301. ;
  302. ;------------------------------------------------------------------------
  303. [InstallOption]
  304.     ;
  305.     ; extract parameters
  306.     ;
  307.     set Option   = $($1)
  308.     set SrcDir   = $($2)
  309.     set AddCopy  = $($3)
  310.     set DoCopy   = $($4)
  311.     set DoConfig = $($5)
  312.  
  313.     ;
  314.     ; Check if the language requested is supported
  315.     ;
  316.     set LanguageList = ^(LanguagesSupported, 1)
  317.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  318.         Return STATUS_NOLANGUAGE
  319.     endif
  320.     Debug-Output "OEMNADNT.INF: STF_CWDIR is: "$(!STF_CWDIR)
  321.  
  322.     ; define all the constants
  323.  
  324.     set-subst LF = "\n"
  325.  
  326.     read-syms GeneralConstants
  327.     read-syms FileConstants
  328.  
  329.     read-syms DialogConstants$(!STF_LANGUAGE)
  330.     ifstr(i) $(!NTN_Origination) == "NCPA"
  331.         set Continue = "OK"
  332.     endif
  333.     read-syms FileConstants$(!STF_LANGUAGE)
  334.  
  335.     detect date
  336.  
  337.     set-title  $(FunctionTitle)
  338.  
  339.     set to   = Begin
  340.     set from = Begin
  341. ;
  342. ;  Assume all is well.
  343. ;
  344.     set CommonStatus = STATUS_SUCCESSFUL
  345.  
  346.     EndWait
  347.  
  348. ;
  349. ;   Set up the operation-mode-based variables and gaily welcome
  350. ;   the user.  If the "install mode" variable is improperly set,
  351. ;   assume this is a new installation.
  352. ;
  353.  
  354. Begin = +
  355.  
  356.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  357.                 set StartLabel = removeadapter
  358.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  359.                 set StartLabel = UpgradeSoftware
  360.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  361.                 set StartLabel = bindingadapter
  362.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  363.                 set StartLabel = configureadapter
  364.     else
  365.                 set StartLabel = installadapter
  366.                 set OEM_ABANDON_OPTIONS = {}
  367.                 set OEM_ABANDON_SOFTWARE = FALSE
  368.                 set OEM_ABANDON_ON = TRUE
  369.     endif
  370.  
  371.  
  372. ;    Set IRQValue = *($(IRQList),2)
  373. ;    Set IOBaseAddrValue = *($(IOBaseAddrValues),1)
  374.  
  375.     set from = $(fatal)
  376.     set to = $(fatal)
  377.     goto $(StartLabel)
  378.  
  379. ;-----------------------------------------------
  380. ; Installation Section
  381. ;-----------------------------------------------
  382.  
  383. installadapter = +
  384.  
  385.     goto adapteroptions
  386.  
  387.  
  388. ;-----------------------------------------------
  389. ; Configuration Section
  390. ;-----------------------------------------------
  391. ;
  392. ;   Get the current values of all the parameters
  393. ;
  394. configureadapter = +
  395.     Ifstr $(KeyProduct) == $(KeyNull)
  396.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  397.         Ifstr $(KeyProduct) == $(KeyNull)
  398.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  399.             Debug-Output "Cannot find component product key"
  400.             goto fatalregistry
  401.         Endif
  402.     Endif
  403.  
  404.     Set AdapterNumber = ""
  405.  
  406.     ;
  407.     ; Get the other parameters;  they're attached to the service parameters key
  408.     ;
  409.     Debug-Output "OEMNADNX.INF: Shelling to FindService"
  410.     Shell $(UtilityInf) FindService, $(KeyProduct)
  411.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  412.         Debug-Output "OEMNADNX.INF: FindService shell failure"
  413.         Goto ShellCodeError
  414.     Endif
  415.     Ifstr(i) $($R0) != NO_ERROR
  416.         Debug-Output "OEMNADNX.INF: FindService Shell error: "$($R0)
  417.         Goto fatalregistry
  418.     endif
  419.  
  420.     set KeyParameters = $($R2)
  421.  
  422.     ;
  423.     ;  We don't need the services key, so close it.
  424.     ;
  425.     CloseRegKey $($R1)
  426.  
  427.     Ifstr $(KeyParameters) == $(KeyNull)
  428.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  429.         Debug-Output "Cannot find component service"
  430.         goto fatalregistry
  431.     endif
  432.  
  433.     set OldVersionExisted = $(TRUE)
  434.  
  435.     set ValueName = ""
  436.     set ValueData = ""
  437.     set ValueStr  = ""
  438.     set ValueList = {}
  439.  
  440.     ;
  441.     ; Get the old values
  442.     ;
  443.     EnumRegValue $(KeyParameters) ValueList
  444.  
  445. ;    ForListDo $(ValueList)
  446. ;
  447. ;        set ValueItem = $($)
  448. ;        set ValueName = *($(ValueItem),1)
  449. ;        set ValueData = *($(ValueItem),4)
  450. ;        Ifstr(i) $(ValueName) == "InterruptNumber"
  451. ;            set IRQValue = $(ValueData)
  452. ;        else-ifstr(i) $(ValueName) == "IoBaseAddress"
  453. ;            set IOBaseAddrValue = $(ValueData)
  454. ;        endif
  455. ;
  456. ;    EndForListDo
  457. ;
  458. ;    ifstr(i) $(IRQValue) == ""
  459. ;        set IRQValue = *($(IRQList), 2)
  460. ;    endif
  461. ;
  462. ;    ifstr(i) $(IOBaseAddrValue) == ""
  463. ;        set IOBaseAddrValue = *($(IOBaseAddrDecList), 1)
  464. ;    endif
  465. ;
  466. ;  Read the symbolic link to the ODI entry from the "OdiLoadName" value
  467. ;
  468.     GetRegValue $(KeyParameters),"OdiLoadName", CardInstanceList
  469.     Set CardInstanceName = *($(CardInstanceList),4)
  470.  
  471. adaptersetup =+
  472.  
  473.     goto adapteroptions
  474. ;
  475. ;   Let the user bang on the options until satisfied.
  476. ;
  477. adapteroptions = +
  478.     set from = adapteroptions
  479.  
  480. ;    set IOBaseAddress = *($(IOBaseAddrHexList), ~($(IOBaseAddrDecList),+
  481. ;        $(IOBaseAddrValue)))
  482. ;
  483. ;    read-syms FileDependentDlg$(!STF_LANGUAGE)
  484. ;
  485. ;    ui start "InputDlg"
  486. ;
  487. ;    ifstr(i) $(DLGEVENT) == "CONTINUE"
  488. ;        set IRQValue = $(Combo1Out)
  489. ;        set IOBaseAddress = $(Combo2Out)
  490. ;        ui pop 1
  491. ;    else-ifstr(i) $(DLGEVENT) == "BACK"
  492. ;        set CommonStatus = STATUS_USERCANCEL
  493. ;        Debug-Output "Action: exit. Bye."
  494. ;        ui pop 1
  495. ;        goto end
  496. ;    else
  497. ;        ;
  498. ;        ; Unknow command
  499. ;        ;
  500. ;        ui pop 1
  501. ;        Debug-Output "Action: unknown. Bye."
  502. ;       goto end
  503. ;    endif
  504. ;
  505. ;    set IOBaseAddrValue = *($(IOBaseAddrDecList), ~($(IOBaseAddrHexList),+
  506. ;        $(IOBaseAddress)))
  507. ;
  508. ;   If installing, go create the necessary keys;
  509. ;   if configuring, they're already open.
  510. ;
  511.     ifint $(OldVersionExisted) == $(TRUE)
  512.         ifstr(i) $(!NTN_InstallMode) == configure
  513.             goto writeparameters
  514.         endif
  515.     endif
  516.  
  517.     StartWait
  518. ;
  519. ;   Create the HARDWARE\Netcard region and its corresponding service
  520. ;
  521.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  522.  
  523.     ifint $($R4) != -1
  524.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  525.     endif
  526.  
  527.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  528.         Debug-Output "Cannot add hardware component"
  529.         goto ShellCodeError
  530.     endif
  531.  
  532.     set RegistryErrorIndex = $($R0)
  533.  
  534.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  535.         EndWait
  536.         Debug-Output "Registry error: add hardware component"
  537.         CloseRegKey $($R1)
  538.         CloseRegKey $($R2)
  539.         CloseRegKey $($R3)
  540.         goto fatalregistry
  541.     endif
  542.  
  543. ;
  544. ;   At this point:
  545. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  546. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  547. ;     $R3  Registry key handle for <service>\Parameters key
  548. ;     $R4  Adapter number assigned to adapter
  549. ;     $R5  Service name generated by combining svc name with adapter number
  550. ;
  551.     set KeyParameters = $($R3)
  552.     set KeyAdapterRules = $($R2)
  553.     set AdapterNumber = $($R4)
  554.  
  555.     Set-add TempAdapterNumber = $(AdapterNumber),0
  556.  
  557.     set CardInstanceName = $(ProductHardwareName)" #"$(TempAdapterNumber)
  558.  
  559.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  560.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  561.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  562.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  563.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  564.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  565.  
  566.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  567.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  568.         Debug-Output "ShellCode error"
  569.         goto ShellCodeError
  570.     endif
  571.  
  572.     CloseRegKey $($R1)
  573.  
  574.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  575.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  576.  
  577.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  578.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  579.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  580.  
  581.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  582.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  583.         Debug-Output "ShellCode error."
  584.         goto ShellCodeError
  585.     endif
  586.  
  587.     set RegistryErrorIndex = $($R0)
  588.  
  589.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  590.         EndWait
  591.         Debug-Output "Resgitry error: add value list."
  592.         CloseRegKey $(KeyParameters)
  593.         CloseRegKey $(KeyAdapterRules)
  594.         goto fatalregistry
  595.     endif
  596.  
  597.     CloseRegKey $(KeyAdapterRules)
  598.  
  599.     SetRegValue $(KeyParameters) {OdiLoadName,$(NoTitle),$(!REG_VT_SZ),$(CardInstanceName)}
  600.  
  601.     goto writeparameters
  602. ;
  603. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  604. ;
  605. writeparameters = +
  606.     Shell $(UtilityInf), GetBusTypeNum
  607.     set BusTypeNum = $($R1)
  608.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  609.         Debug-Output "ShellCode error."
  610.         goto ShellCodeError
  611.     endif
  612. ;
  613. ;   Add the rest of the parameters to the Services area
  614. ;
  615.     set NewValueList = { +
  616.                        {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  617.                        {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  618.                        }
  619.  
  620.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  621.  
  622.     CloseRegKey $(KeyParameters)
  623.  
  624.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  625.         Debug-Output "ShellCode error."
  626.         goto ShellCodeError
  627.     endif
  628.  
  629.     set RegistryErrorIndex = $($R0)
  630.  
  631.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  632.         Debug-Output "Registry error: Add value list"
  633.         goto fatalregistry
  634.     endif
  635.  
  636. ;
  637. ; Check for NE2 service, If found change start to 4 so it is not loaded
  638. ;
  639.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ProductHardwareName) $(MAXIMUM_ALLOWED) KeyNE2
  640.     Ifstr(i) $(KeyNE2) != $(KeyNull)
  641.         SetRegValue $(KeyNE2) {Start,$(NoTitle),$(!REG_VT_DWORD),4}
  642.     Endif
  643.  
  644.     EndWait
  645.  
  646. ;
  647. ;  TRAVIS: Put the ODILOAD update info here!
  648. ;
  649.     Debug-Output "Add ODILOAD Parameters"
  650.  
  651.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\OdiLoad" $(MAXIMUM_ALLOWED) KeyOdiLoad
  652.     Ifstr $(KeyOdiLoad) == $(KeyNull)
  653.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  654.         Debug-Output "Cannot find OdiLoad "
  655.         goto fatalregistry
  656.     Endif
  657.  
  658.     Set KeyOdiCard = $(KeyNull)
  659.     Debug-Output "CardInstanceName = "$(CardInstanceName)
  660.  
  661.     set CloseOdiModules = ""
  662.  
  663.     Ifstr(i) $(AdapterNumber) != ""
  664.         ;  This adapter was just installed; allow creation of the #nn key
  665.     CreateRegKey $(KeyOdiLoad) {$(OdiModules),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiModules
  666.     Ifstr(i) $(KeyOdiModules) == $(KeyNull)
  667.         OpenRegKey $(KeyOdiLoad) "" $(OdiModules) $(MAXIMUM_ALLOWED) KeyOdiModules
  668.         Ifstr(i) $(KeyOdiLoad) == $(KeyNull)
  669.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  670.         Debug-Output "Cannot find OdiLoad\"$(OdiModules)
  671.             goto fatalregistry
  672.         Endif
  673.     Endif
  674.     set CloseOdiModules = "1"
  675.         CreateRegKey $(KeyOdiModules) {$(CardInstanceName),$(NoTitle),GenericClass} "" $(MAXIMUM_ALLOWED) "" KeyOdiCard
  676.     Endif
  677.  
  678.     Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  679.         ;
  680.         ;  This is either an old card, or a prior version of the key existed.
  681.         ;
  682.     OpenRegKey $(KeyOdiLoad) "" $(OdiModules)\$(CardInstanceName) $(MAXIMUM_ALLOWED) KeyOdiCard
  683.     Ifstr(i) $(KeyOdiCard) == $(KeyNull)
  684.             set RegistryErrorIndex = CANNOT_FIND_COMPONEXT_SERVICE
  685.         Debug-Output "Can't create ODILOAD\"$(CardInstanceName)
  686.         goto fatalresistry
  687.     Endif
  688.     Endif
  689.  
  690. ;    set IOBaseAddressNw = *($(IOBaseAddrNwList), ~($(IOBaseAddrHexList),+
  691. ;        $(IOBaseAddress)))
  692. ;
  693. ;    Debug-Output "OEMNADXN.INF: IOBaseAddress = "$(IOBaseAddress)
  694.  
  695.     set OdiParmList = {"Frame ETHERNET_802.3", +
  696.                "Frame ETHERNET_802.2", +
  697.                "Frame ETHERNET_II", +
  698.                "Frame ETHERNET_SNAP", +
  699.               }
  700.         
  701.     SetRegValue $(KeyOdiCard) {"Parameters",$(NoTitle),$(!REG_VT_MULTI_SZ),$(OdiParmList)}
  702.  
  703.     CloseRegKey $(KeyOdiLoad)
  704.     Ifstr(i) $(CloseOdiModules) != $(KeyNull)
  705.         CloseRegKey $(KeyOdiModules)
  706.     Endif
  707.     CloseRegKey $(KeyOdiCard)
  708.  
  709. ;
  710. ; Update the card name in IpxSpxII to be the last card installed
  711. ;
  712.     set IpxParameters = $(!NTN_ServiceBase)"\IpxSpxII\Parameters"
  713.     OpenRegKey $(!REG_H_LOCAL) "" $(IpxParameters) $(MAXIMUM_ALLOWED) KeyIpxParameters
  714.     Ifstr(i) $(KeyIpxParameters) == ""
  715.         Debug-Output "OEMNADNA.INF: Can't update IpxSpxII CardName"
  716.     Else
  717.         Split-String $(CardInstanceName) " " CardNameParts
  718.     set CardNameBase = *($(CardNameParts),1)
  719.         SetRegValue $(KeyIpxParameters) {"CardName",$(NoTitle),$(!REG_VT_SZ),$(CardNameBase)}
  720.     CloseRegKey $(KeyIpxParameters)
  721.     Endif
  722.  
  723.     goto successful
  724.  
  725. ;-----------------------------------------------
  726. ; Binding section
  727. ;-----------------------------------------------
  728. bindingadapter =+
  729.     set Error = "Binding: Sorry, not yet implemented."
  730.     goto fatal
  731.  
  732. ;-----------------------------------------------
  733. ; Removeadapter section
  734. ;-----------------------------------------------
  735.  
  736. removeadapter = +
  737. ;
  738. ;  TRAVIS: Put the ODILOAD adapter removal stuff here!
  739. ;
  740.  
  741. ;
  742. ; Delete the Services\OdiLoad\Odi_Modules\xxxxxx #01 card instance.
  743. ;
  744.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyParameters
  745.     Ifstr(i) $(KeyParameters) == ""
  746.  
  747.         Debug-Output "OEMNADNA.INF: removeadapter, Can't open "$(!NTN_RegBase)
  748.  
  749.     Else
  750.  
  751.         GetRegValue $(KeyParameters),"ServiceName", ServiceNameList
  752.         Set ServiceName = *($(ServiceNameList),4)
  753.         CloseRegKey $(KeyParameters)
  754.  
  755.  
  756.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_ServiceBase)"\"$(ServiceName)"\Parameters" $(MAXIMUM_ALLOWED) KeyService
  757.     ifstr(i) $(KeyService) == ""
  758.  
  759.         Debug-Output "OEMNADNA.INF: removeadapter, Can't open "$(ServiceName)
  760.  
  761.     Else
  762.         GetRegValue $(KeyService),"OdiLoadName", CardInstanceList
  763.         Set CardInstanceName = *($(CardInstanceList),4)
  764.         CloseRegKey $(KeyService)
  765.  
  766.         Set OdiModuleName = $(!NTN_ServiceBase)"\"$(DriverName)"\"$(OdiModules)
  767.             OpenRegKey $(!REG_H_LOCAL) "" $(OdiModuleName) $(MAXIMUM_ALLOWED) KeyOdiModules
  768.             Ifstr(i) $(KeyOdiModules) == ""
  769.  
  770.                 Debug-Output "OEMNADNA.INF: removeadapter, Can't open "$(OdiModulesName)
  771.  
  772.             Else
  773.                 Debug-Output "OEMNADNA.INF: Deleting card "$(CardInstanceName)
  774.         Debug-Output "OEMNADNA.INF: From Key "$(OdiModuleName)
  775.  
  776.                 DeleteRegTree $(KeyOdiModules) $(CardInstanceName)
  777.  
  778.         FlushRegKey $(KeyOdiModules)
  779.         CloseRegKey $(KeyOdiModules)
  780.  
  781.             Endif
  782.     Endif
  783.  
  784.     Endif
  785.  
  786. ;
  787. ; Increment the OdiLoad reference count so OdiLoad is not removed as a
  788. ; service.
  789. ;
  790.  
  791.     Shell $(UtilityInf), IncrementRefCount, $(ProductKeyName)
  792.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  793.         Debug-Output "ShellCode error removeadapter"
  794.         goto ShellCodeError
  795.     Endif
  796.  
  797.     set RegistryErrorIndex = $($R0)
  798.  
  799.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  800.         goto fatalregistry
  801.     Endif
  802.  
  803.     Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  804.             $(DriverName), $(!NTN_RegBase)
  805.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  806.         Debug-Output "ShellCode error"
  807.         goto ShellCodeError
  808.     endif
  809.  
  810.     set RegistryErrorIndex = $($R0)
  811.  
  812.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  813.         goto fatalregistry
  814.     endif
  815.  
  816. ; Decrement the reference count so OdiLoad can be removed when all the
  817. ; ODI adapters have been removed.
  818. ;
  819.     Shell $(UtilityInf), DecrementRefCount, $(ProductKeyName)
  820.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  821.         Debug-Output "ShellCode error removeadapter"
  822.         goto ShellCodeError
  823.     Endif
  824.  
  825.     set RegistryErrorIndex = $($R0)
  826.  
  827.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  828.         goto fatalregistry
  829.     Endif
  830.  
  831.     goto end
  832.  
  833. ;-----------------------------------------------
  834. ; Upgrade Software section
  835. ;-----------------------------------------------
  836.  
  837. UpgradeSoftware = +
  838.     ;
  839.     ; upgrade/update hardware component
  840.     ; There is no different between upgrade and update for hardware
  841.     ; component
  842.     ;
  843.     ; 1. Get the Service Name
  844.     ; 2. Change the NetRule section if necessary
  845.     ;
  846.     OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  847.           $(MAXIMUM_ALLOWED) NetworkCardKey
  848.     Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  849.         ;
  850.         ; Get Service name
  851.         ;
  852.         GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  853.         set ServiceName = *($(ServiceNameInfo), 4)
  854.  
  855.         ;
  856.         ; Change the NetRule if necessary
  857.         ;
  858.         OpenRegKey $(NetworkCardKey) "" "NetRules" +
  859.             $(MAXIMUM_ALLOWED) NetRuleKey
  860.         Ifstr(i) $(NetRuleKey) != $(KeyNull)
  861.             ;
  862.             ; Make the change....
  863.             ;
  864.         else
  865.             ;
  866.             ; Error, cannot open net rules key
  867.             ;
  868.             goto fatalregistry
  869.         endif
  870.  
  871.         CloseRegKey $(NetRules)
  872.         CloseRegKey $(NetworkCardKey)
  873.     else
  874.         ;
  875.         ; Error, cannot open network card key
  876.         ;
  877.         goto fatalregistry
  878.     endif
  879.     ;
  880.     ; 3. Change the service section of the hardware. i.e.,
  881.     ;    ParameterName change, value change, etc.
  882.     ;
  883.     OpenRegKey $(!REG_H_LOCAL) "" +
  884.           $(!NTN_ServiceBase)"\"$(ServiceName) +
  885.           $(MAXIMUM_ALLOWED) ServiceKey
  886.  
  887.     Ifstr(i) $(ServiceKey) != $(KeyNull)
  888.         ;
  889.         ; Get the ServiceKey to change the Start value
  890.         ; or Type value. Or open Parameters key to
  891.         ; change the hardware parameters if necessary.
  892.         ;
  893.         CloseRegKey $(ServiceKey)
  894.     else
  895.         ;
  896.         ; Error, cannot open network card key
  897.         ;
  898.         goto fatalregistry
  899.     endif
  900.  
  901.     goto end
  902.     ;
  903.     ; End of Upgrade Software
  904.     ;
  905.  
  906. ;
  907. ;  Escape hatches
  908. ;
  909. successful = +
  910.     goto end
  911.  
  912. abandon = +
  913.     ForListDo $(OEM_ABANDON_OPTIONS)
  914.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  915.             $(DriverName), $($)
  916.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  917.             Debug-Output "ShellCode error"
  918.             goto ShellCodeError
  919.         endif
  920.  
  921.         set RegistryErrorIndex = $($R0)
  922.  
  923.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  924.             goto fatalregistry
  925.         endif
  926.     EndForListDo
  927.  
  928.     goto end
  929.  
  930. ;
  931. ; warning display
  932. ;
  933. warning = +
  934.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  935.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  936.         goto ShellCodeError
  937.     endif
  938.     ifstr(i) $($R1) == "OK"
  939.         goto $(to)
  940.     else-ifstr(i) $($R1) == "CANCEL"
  941.         goto $(from)
  942.     else
  943.         goto "end"
  944.     endif
  945.  
  946.  
  947. ;
  948. ; non fatal error display
  949. ;
  950. nonfatalinfo = +
  951.     Set CommonStatus = STATUS_USERCANCEL
  952.     Set Severity = STATUS
  953.     goto nonfatalmsg
  954. nonfatal = +
  955.     Set Severity = NONFATAL
  956.     goto nonfatalmsg
  957. nonfatalmsg = +
  958.     ifstr(i) $(Error) == ""
  959.         Set Severity = NONFATAL
  960.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  961.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  962.             goto ShellCodeError
  963.         endif
  964.         set Error = $($R0)
  965.     endif
  966.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  967.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  968.         goto ShellCodeError
  969.     endif
  970.     ifstr(i) $($R1) == "OK"
  971.         goto $(from)
  972.     else
  973.         goto "end"
  974.     endif
  975.  
  976. ;
  977. ;  Registry is broken
  978. ;
  979. fatalregistry = +
  980.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  981.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  982.         goto ShellCodeError
  983.     endif
  984.     set Error = $($R0)
  985.     goto fatal
  986.  
  987. fataldetect = +
  988.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  989.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  990.         Debug-Output "ShellCode error: cannot get an error string."
  991.         goto ShellCodeError
  992.     endif
  993.     set Error = $($R0)
  994.     Goto fatal
  995. ;
  996. ; fatal error display
  997. ;
  998. fatal = +
  999.     ifstr(i) $(Error) == ""
  1000.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1001.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1002.             goto ShellCodeError
  1003.         endif
  1004.         set Error = $($R0)
  1005.     endif
  1006.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1007.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1008.         goto ShellCodeError
  1009.     endif
  1010.  
  1011.     goto setfailed
  1012.  
  1013. ;
  1014. ;  Shelling error
  1015. ;
  1016. ShellCodeError = +
  1017.     set DlgType      = "MessageBox"
  1018.     set STF_MB_TITLE = "Error: "$(FunctionTitle)
  1019.     set STF_MB_TEXT  = "Shell Code Error"
  1020.     set STF_MB_TYPE  = 1
  1021.     set STF_MB_ICON  = 3
  1022.     set STF_MB_DEF   = 1
  1023.     ui start "Error Message"
  1024.     goto setfailed
  1025.  
  1026. setfailed = +
  1027.     set CommonStatus = STATUS_FAILED
  1028.     ;
  1029.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1030.     ;
  1031.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1032.         set OEM_ABANDON_ON = FALSE
  1033.         goto abandon
  1034.     endif
  1035.     goto end
  1036.  
  1037. end = +
  1038.     goto term
  1039.  
  1040. term = +
  1041.  
  1042.     Return $(CommonStatus)
  1043.  
  1044. ;***************************************************************
  1045. ;  INSTALL SECTIONS
  1046. ;***************************************************************
  1047. [Install-Option]
  1048.     set STF_VITAL = ""
  1049.  
  1050.     ifstr(i) $(AddCopy) == "YES"
  1051.  
  1052.         ;
  1053.         ; Add the files to the copy list
  1054.         ;
  1055.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1056.  
  1057.     endif
  1058.  
  1059.     ifstr(i) $(DoCopy) == "YES"
  1060.  
  1061.        ;
  1062.        ; Copy files in the copy list
  1063.        ;
  1064.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1065.        CopyFilesInCopyList
  1066.  
  1067.     endif
  1068.  
  1069.     ifstr(i) $(DoConfig) == "YES"
  1070.         ;
  1071.         ; Add product to registry
  1072.         ;
  1073.  
  1074.         ;
  1075.         ; Finish up
  1076.     endif
  1077.  
  1078.     Exit
  1079.  
  1080. [Install-Update]
  1081.    set STF_VITAL        = ""
  1082.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1083.    ;set STF_VERSION     = "YES"
  1084.  
  1085.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1086.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1087.  
  1088.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1089.    CopyFilesInCopyList
  1090.  
  1091.    exit
  1092.  
  1093. [Source Media Descriptions]
  1094.     1  = "Windows NT Setup Disk #1"  , TAGFILE = disk1
  1095.     2  = "Windows NT Setup CD-ROM Disk"  , TAGFILE = disk2
  1096.     99    = "LMHOST disk", TAGFILE = lmhosts
  1097. [ProductType]
  1098. STF_PRODUCT  = Winnt
  1099. STF_PLATFORM = I386
  1100. [Files-Inf]
  1101. 2,    oemsetup.inf,     SIZE=1000,    RENAME=$(!UG_Filename)
  1102. [Files-ODI_NE2]
  1103. 2,NE2.lan , SIZE=20000
  1104.  
  1105.  
  1106.